package com.qn.controller;

import com.qn.grpc.protobuf.news.News;
import com.qn.service.GrpcClientService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * grpc端控制器
 *
 * @author qn
 * @date 2023/03/17
 */
@RestController
public class GrpcClientController {
 
    @Resource
    private GrpcClientService grpcClientService;
 
    @GetMapping("/list")
    public List<News> oneToOne(@RequestParam(defaultValue = "data") String data) {
        return grpcClientService.
                list(data);
    }
 
}